package cn.s1995.sloth.bizs.mapper;

import cn.s1995.sloth.common.data.datascope.SlothBaseMapper;
import cn.s1995.sloth.bizs.entity.ProdEvaluate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ProdEvaluateMapper extends SlothBaseMapper<ProdEvaluate> {

	@Select("SELECT ROUND(IFNULL(AVG(score),0),1) FROM biz_prod_evaluate WHERE prod_id = #{prodId} AND state = 1")
	Double getProdAvgScore(@Param("prodId") Long prodId);


}
